<?php
namespace Home\Controller;

class NewsController extends HomeBaseController
{

    /**
     *  交易大厅
     */
    public function index()
    {
        $page=I('page',0);
        $this->assign("page",$page);
        $size=20;
        $count=M('UserPage')->count();
        $this->assign("count",$count);
        $pageSize=floor($count/$size);
        if($count%$size>0){
            $pageSize=$pageSize+1;
        }
        $start=0;
        if($page>0){
            $start=$page*$size;
        }
        $this->assign("pageSize",$pageSize);
        $list=M('UserPage')->order('createdate desc')->limit($start,$size)->select();
        $this->assign("list",$list);
        $this->display('news/index');
    }
    
}